<template>
    <div style="background-color: darkgrey;">
        左侧商品导航组件
        <ul>
            <li v-for="item in nav" :key="item.id">
                <a href="" @click.prevent="clickHandle(item.id)">{{ item.name }}</a>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    data() {
        return {
            nav:[
                {id:'1',name:'冰淇淋'},
                {id:'2',name:'蛋糕'},
                {id:'3',name:'巧克力'},
            ]
        }
    },
    methods: {
        clickHandle(cid) {
            this.$emit('handle',cid)
        }
    }
}
</script>